package com.carbonFoot;

public class Car implements CarbonFootPrint {
	
	private String combustivel;
	private float cilindrada;
	
	
	public Car(String combustivel, float cilindrada) {
		super();
		this.combustivel = combustivel;
		this.cilindrada = cilindrada;
	}


	public String getCombustivel() {
		return combustivel;
	}


	public void setCombustivel(String combustivel) {
		this.combustivel = combustivel;
	}


	public float getCilindrada() {
		return cilindrada;
	}


	public void setCilindrada(float cilindrada) {
		this.cilindrada = cilindrada;
	}


	@Override
	public float getCarbonFootPrint() {
		// TODO Auto-generated method stub
		float result = 0;
		
		if(this.combustivel.equals("gasolina")){
			result += (float)( this.cilindrada * 10);
		}else if(this.combustivel.equals("alcool")){
			result += (float) (this.cilindrada * 8);
		}else{
			result += (float)(this.cilindrada * 5);
		}
		return result;
	}


	@Override
	public String toString() {
		return "Car\ncombustivel=" + combustivel + "\ncilindrada=" + cilindrada;
	}
	
}
	
